package ThreadBasicTest;

public class TestThreaf02 {
    public static void main(String[] args) {
        //3.创建实现对象
        MyRunnable myRunnable = new MyRunnable();
        Thread thread = new Thread(myRunnable);//40创建线程对象
        thread.start();//5.调用run方法
        for (int i = 0; i <10 ; i++) {
            System.out.println("Main"+"\t");
        }
    }

}
//1.实现Runnable接口
class MyRunnable implements Runnable{
//2/\.覆盖run()ff
    @Override
    public void run() {
        for (int i = 0; i <10 ; i++) {
         //   System.out.println("MyRunnable:"+i);
            System.out.println(Thread.currentThread().getName()+"-"+i);
        }
    }
}